package forumDomains

/**
 * Created with IntelliJ IDEA.
 * User: Install
 * Date: 12.04.13
 * Time: 13:57
 * To change this template use File | Settings | File Templates.
 */
class User {

    String nome;
    String cognome;
    String password;
    String email;

    static hasMany = [post: Post]

    //List<Post> listaPost;

    static constraints={
        nome(blanck: false)
        cognome(blanck: false)
        password(unique: true, length: 8..20,
                validator:
                        { val, obj ->
                            if (val?.equalsIgnoreCase(obj.nomeUtente)) {
                                return false
                            }
                        })
        email(email: true)

    }
}
